<?php
Route::namespace('Admin')->name('admin.')->prefix('liuhecai4')->group(function () {
    Route::namespace('Auth')->group(function () {
        Route::get('login', 'LoginController@showLoginForm')->name('login');
        Route::post('login', 'LoginController@login')->name('postLogin');
        Route::get('register', 'RegisterController@showRegistrationForm')->name('register');
        Route::post('register', 'RegisterController@register')->name('postRegister');
        Route::get('/logout', 'LoginController@logout')->name('logout');
    });
    Route::middleware('auth:admin')->prefix('admin')->group(function () {
        Route::get('/', 'IndexController@index');//agent
        Route::post('/img', 'IndexController@img')->name('adminimg');//头像上传
        Route::prefix('user')->name('user.')->group(function (){
            Route::get('create', 'UserController@create')->name('create');
            Route::post('store', 'UserController@store')->name('store');
            Route::get('update/{id}', 'UserController@update')->name('update');
            Route::post('edit', 'UserController@edit')->name('edit');
            Route::get('/delete', 'UserController@delete')->name('delete');
        });
//        Route::prefix('config')->name('config.')->group(function () {
//            Route::get('update', 'ConfigController@update')->name('update');
//            Route::post('edit', 'ConfigController@edit')->name('edit');
//        });
    });
});